package shiyansi;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

public class money
{
    public static final int a=60;//优秀分数的奖学金
    public static final int b=30;//及格分数的奖学金
    public static Double rate = null;//税率
    public static final int weekCount = 18;//周数
    public static Map<String, List<Student>> roomStudentMap = null;

    public static void dePartureRoom(Student student, Lab classRoom) {
        System.out.println( classRoom.getName() + "分配给" + student.getName() + "");
        String roomId = classRoom.getId();
        if (roomStudentMap == null) {
            roomStudentMap = new HashMap<String, List<Student>>();
            List<Student> studentIdList = new ArrayList<Student>();
            studentIdList.add(student);
            roomStudentMap.put(roomId, studentIdList);
        } else {
            if (roomStudentMap.get(roomId) == null) {
                List<Student> studentIdList = new ArrayList<Student>();
                studentIdList.add(student);
                roomStudentMap.put(roomId, studentIdList);
            } else {
                List<Student> studentIdList = roomStudentMap.get(roomId);
                studentIdList.add(student);
                roomStudentMap.put(roomId, studentIdList);
            }
        }
    }

    public static void calculateGrade(Student student) {
        int excellentCount = student.getExcellentGrade();
        int passCount = student.getPassGrade();
        int priceBefore = a * excellentCount + b * passCount;
        System.out.println(student.getName() + "勤工俭学收入" + priceBefore);
        double price = priceBefore - priceBefore * rate;
        System.out.println(student.getName() + "税后实际收入" + price);
    }
}
